<?xml version="1.0" ?>
<!DOCTYPE html 
  PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>docs/container.rd</title>
</head>
<body>
<h2><a name="label-0" id="label-0">BDB::XML::Container</a></h2><!-- RDLabel: "BDB::XML::Container" -->
<p>The XML::Container class encapsulates a document container and its 
related indices and statistics. XML::Container exposes methods for
managing (putting and deleting) XML::Document objects, managing indices,
and retrieving container statistics.</p>
<p>Module included : Enumerable</p>
<h3><a name="label-1" id="label-1">Methods</a></h3><!-- RDLabel: "Methods" -->
<dl>
<dt><a name="label-2" id="label-2"><code>delete(<var>doc_or_name</var>, <var>context</var> = <var>nil</var>)</code></a></dt><!-- RDLabel: "delete" -->
<dd>
Remove the document from the container
<dl>
<dt><a name="label-3" id="label-3"><var>doc_or_name</var></a></dt><!-- RDLabel: "doc_or_name" -->
<dd>
doc_or_name is an <var>BDB::XML::Document</var> previously stored,
or the name of an existent document
</dd>
<dt><a name="label-4" id="label-4"><var>context</var></a></dt><!-- RDLabel: "context" -->
<dd>
an optional Update context
</dd>
</dl></dd>
<dt><a name="label-5" id="label-5"><code>index?</code></a></dt><!-- RDLabel: "index?" -->
<dd>
Returns true if the container is configured to create node indexes.</dd>
<dt><a name="label-6" id="label-6"><code>manager</code></a></dt><!-- RDLabel: "manager" -->
<dd>
return the current manager for the container, or <var>nil</var></dd>
<dt><a name="label-7" id="label-7"><code>pagesize</code></a></dt><!-- RDLabel: "pagesize" -->
<dd>
Returns true if the container is configured to create node indexes.</dd>
<dt><a name="label-8" id="label-8"><code>each {|<var>doc</var>| ... }</code></a></dt><!-- RDLabel: "each" -->
<dd>
Iterate over all documents</dd>
<dt><a name="label-9" id="label-9"><code>self[id]</code></a></dt><!-- RDLabel: "self[id]" -->
<dd>
Fetch the document from the container
<dl>
<dt><a name="label-10" id="label-10"><var>id</var></a></dt><!-- RDLabel: "id" -->
<dd>
the id assigned to the document when it was first added to a container
</dd>
<dt><a name="label-11" id="label-11"><var>flags</var></a></dt><!-- RDLabel: "flags" -->
<dd>
flags can has the value 0 or <var>BDB::DIRTY_READ</var>, <var>BDB::RMW</var>
</dd>
</dl></dd>
<dt><a name="label-12" id="label-12"><code>get(<var>id</var>, <var>flags</var> = <var>0</var>)</code></a></dt><!-- RDLabel: "get" -->
<dd>
same than <var> self[id]</var></dd>
<dt><a name="label-13" id="label-13"><code>self[id] = <var>document</var></code></a></dt><!-- RDLabel: "self[id] = document" -->
<dd>
Replace the document (see also #update)</dd>
<dt><a name="label-14" id="label-14"><code>index = <var>index</var></code></a></dt><!-- RDLabel: "index = index" -->
<dd>
set the indexing : <var>index</var> must be an <var>XML::Index</var> object</dd>
<dt><a name="label-15" id="label-15"><code>index</code></a></dt><!-- RDLabel: "index" -->
<dd>
<p>Retrieve the <var>BDB::XML::Index</var></p>
<p>Return <var>nil</var> if no indexing was specified</p></dd>
<dt><a name="label-16" id="label-16"><code>add_index(<var>uri</var>, <var>name</var>, <var>index</var>, <var>context</var> = <var>nil</var>)</code></a></dt><!-- RDLabel: "add_index" -->
<dt><a name="label-17" id="label-17"><code>add_index(<var>uri</var>, <var>name</var>, <var>type</var>, <var>syntax</var>, <var>context</var> = <var>nil</var>)</code></a></dt><!-- RDLabel: "add_index" -->
<dd>
Add a new index : this is a convenient method. See <var>XML::Index#add</var></dd>
<dt><a name="label-18" id="label-18"><code>add_default_index(<var>index</var>, <var>context</var> = <var>nil</var>)</code></a></dt><!-- RDLabel: "add_default_index" -->
<dd>
Add default index : this is a convenient method. See <var>XML::Index#add_default</var></dd>
<dt><a name="label-19" id="label-19"><code>delete_index(<var>index</var>, <var>context</var> = <var>nil</var>)</code></a></dt><!-- RDLabel: "delete_index" -->
<dd>
Delete an index : this is a convenient method. See <var>XML::Index#delete</var></dd>
<dt><a name="label-20" id="label-20"><code>delete_default_index(<var>index</var>, <var>context</var> = <var>nil</var>)</code></a></dt><!-- RDLabel: "delete_default_index" -->
<dd>
Delete default index : this is a convenient method. See <var>XML::Index#delete_default</var> </dd>
<dt><a name="label-21" id="label-21"><code>replace_index(<var>index</var>, <var>context</var> = <var>nil</var>)</code></a></dt><!-- RDLabel: "replace_index" -->
<dd>
Replace an index : this is a convenient method. See <var>XML::Index#replace</var></dd>
<dt><a name="label-22" id="label-22"><code>replace_default_index(<var>index</var>, <var>context</var> = <var>nil</var>)</code></a></dt><!-- RDLabel: "replace_default_index" -->
<dd>
Replace default index : this is a convenient method. See <var>XML::Index#replace_default</var> </dd>
<dt><a name="label-23" id="label-23"><code>name</code></a></dt><!-- RDLabel: "name" -->
<dd>
return the name of the container</dd>
<dt><a name="label-24" id="label-24"><code>type</code></a></dt><!-- RDLabel: "type" -->
<dd>
Return the type of the container</dd>
<dt><a name="label-25" id="label-25"><code>put(<var>document</var>, <var>flags</var> = <var>0</var>)</code></a></dt><!-- RDLabel: "put" -->
<dd>
Add a document to the container and return an ID
<dl>
<dt><a name="label-26" id="label-26"><var>document</var></a></dt><!-- RDLabel: "document" -->
<dd>
an object <var>BDB::XML::Document</var>
</dd>
<dt><a name="label-27" id="label-27"><var>flags</var></a></dt><!-- RDLabel: "flags" -->
<dd>
flags can be 0 or <var>BDB::XML::GEN_NAME</var>
</dd>
</dl></dd>
<dt><a name="label-28" id="label-28"><code>transaction</code></a></dt><!-- RDLabel: "transaction" -->
<dd>
return the transaction associated with the container, or <var>nil</var></dd>
<dt><a name="label-29" id="label-29"><code>in_transaction?</code></a></dt><!-- RDLabel: "in_transaction?" -->
<dd>
return <var>true</var> if the container is associated with a transaction</dd>
<dt><a name="label-30" id="label-30"><code>transaction?</code></a></dt><!-- RDLabel: "transaction?" -->
<dd>
same than <var> in_transaction?</var></dd>
<dt><a name="label-31" id="label-31"><code>update(<var>document</var>, <var>context</var> = <var>nil</var>)</code></a></dt><!-- RDLabel: "update" -->
<dd>
Update a document within the container
<dl>
<dt><a name="label-32" id="label-32"><var>document</var></a></dt><!-- RDLabel: "document" -->
<dd>
an XML::Document to be updated
</dd>
<dt><a name="label-33" id="label-33"><var>context</var></a></dt><!-- RDLabel: "context" -->
<dd>
an optional Update context
</dd>
</dl></dd>
<dt><a name="label-34" id="label-34"><code>sync</code></a></dt><!-- RDLabel: "sync" -->
<dd>
Flush database pages for the container to disk</dd>
<dt><a name="label-35" id="label-35"><code>flags</code></a></dt><!-- RDLabel: "flags" -->
<dd>
Get the flags used to open the container.</dd>
<dt><a name="label-36" id="label-36"><code>node(<var>handle</var>, <var>flags</var> = <var>0</var>)</code></a></dt><!-- RDLabel: "node" -->
<dd>
Get the specified node.
<dl>
<dt><a name="label-37" id="label-37"><var>handle</var></a></dt><!-- RDLabel: "handle" -->
<dd>
must be obtained using XML::Value.node_handle
</dd>
<dt><a name="label-38" id="label-38"><var>flags</var></a></dt><!-- RDLabel: "flags" -->
<dd>
must be set to 0 or, <var>BDB::READ_UNCOMMITED</var>
<var>BDB::READ_UNCOMMITED</var>, <var>BDB::RMW</var>
<var>BDB::XML::LAZY_DOCS</var>
</dd>
</dl></dd>
<dt><a name="label-39" id="label-39"><code>event_writer(<var>document</var>, <var>update_context</var>, <var>flags</var> = <var>0</var>)</code></a></dt><!-- RDLabel: "event_writer" -->
<dd>
<p>Begins insertion of an <var>XML::Document</var> into the container through use of an 
<var>XML::EventWriter</var> object.</p>
<p>Return the <var>XML::EventWriter</var> which must be closed at end.</p></dd>
</dl>

</body>
</html>
